<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
  <script src="ckeditor/sample-css/sample.js" type="text/javascript"></script>
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<script>
 	function deleteFunction(frm){
 		var isDel = confirm("Bạn có muốn xóa người dùng này?");
 		if (isDel) {
 			return true;
 		} else {
 			return false;
 		}
 	}
</script>
          <div id="gwcswA" class="gwcswWrap">
            <div class="gwcswNav">
            <div class="gwcswNavWrap"><table width="437"><tbody><tr><td width="320" index="0">
            </td></tr></tbody></table></div></div>
            <div class="gwcswSlots">
              <div index="1" class="gwcswSlot" style="display: block; font-size: 14px;">
                <p>Danh sách người dùng</p>
              
           	 <table class="spchonmua" style="width: 565px; float: left; border: 1px double #E4E4E4; height: 150px;">
	<tbody>
    	<tr>
			<td align="center" style="width: 5%; border: 1px double #E4E4E4" class="cssTitle"><a
				class="text_vangto">STT</a></td>
			<td align="center" width="17% style=" border: 1px double #E4E4E4" class="cssTitle" colspan="2"><a
				class="text_vangto">Tên đăng nhập</a></td>
			<td align="center" width="25%" style=" border: 1px double #E4E4E4" class="cssTitle"><a
				class="text_vangto">Email</a></td>
			<td align="center" width="25%" style=" border: 1px double #E4E4E4" class="cssTitle"><a
				class="text_vangto">Họ và tên</a></td>
			<c:if test="${not empty isAdmin}">
				<td align="center" width="5%" style=" border: 1px double #E4E4E4" class="cssTitle"><a
					class="text_vangto">Xóa </a></td>
			</c:if>
		</tr>
		<c:set var="stt" value="0"/>
    <c:forEach var="user" items="${listuser}">
	
		<tr style="background-color: white;">
			<td align="center" style=" border: 1px double #E4E4E4" ><a class="text_tin"><c:out value="${stt+1}"/></a></td>
			<td align="center" colspan="2" style=" border: 1px double #E4E4E4"><a href="detailuser.html?id=${user.id}" class="text_tin">${user.id}</a></td>
			<td align="center" style=" border: 1px double #E4E4E4"><a class="text_tin">${user.email}</a></td>
			<td align="center" style=" border: 1px double #E4E4E4"><a class="text_tin">${user.name}</a></td>
			<c:if test="${not empty isAdmin}">
				<td align="center" colspan="2" style=" border: 1px double #E4E4E4">
					<form name="frmDel${user.id}" action='delUser.do' method="post"> 
						<input type="hidden" name="key" value="${user.key}" /> 
						<input id="product-code-id" type="hidden" name="id" value="${user.id}" /> 
						<button onclick='return deleteFunction("frmDel${user.id}");'>-</button> 
					</form>
				</td>
			</c:if>
		</tr>
		<c:set var="stt" value="${stt+1}"/>
	</c:forEach>
	
    </table>

              </div>
         </div>
        </div>